package com.kaesun.ufit.weight;

import android.app.Activity;
import android.os.Bundle;
import android.os.Message;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;

import com.kaesun.ufit.hardware.Buzzer;
import com.kaesun.ufit.tools.ConfigData;
import com.kaesun.ufit.tools.ModelList;
import com.kaesun.ufit.tools.ToolbarView;

public class GuideActivity extends Activity implements View.OnClickListener, IOnHandlerMessage {
	/*private static final String TAG = "GuideActivity";
	private void log(String log) {
		Log.i(TAG, log);
	}*/

	private static final int BUTTON_IDS[] = {
		R.id.button_back, R.id.button_warning, R.id.button_guide,

		R.id.button_arrow_left, R.id.button_arrow_right
	};

	private static final int IMAGE_SLP[] = {
		R.drawable.img_guide_slp_1, 0, 0,
		R.drawable.img_guide_slp_2, R.drawable.img_guide_slp_3, R.drawable.img_guide_slp_4,
		R.drawable.img_guide_slp_5, 0, 0,
		R.drawable.img_guide_slp_4, R.drawable.img_guide_slp_3, R.drawable.img_guide_slp_2,
	};
	private static final int IMAGE_LS[] = {
		R.drawable.img_guide_ls_1, 0, 0,
		R.drawable.img_guide_ls_2, R.drawable.img_guide_ls_3,
		R.drawable.img_guide_ls_4, 0, 0,
		R.drawable.img_guide_ls_3, R.drawable.img_guide_ls_2,
	};
	private static final int IMAGE_HA[] = {
		R.drawable.img_guide_ha_1, 0, 0,
		R.drawable.img_guide_ha_2, R.drawable.img_guide_ha_3, R.drawable.img_guide_ha_4,
		R.drawable.img_guide_ha_5, 0, 0,
		R.drawable.img_guide_ha_4, R.drawable.img_guide_ha_3, R.drawable.img_guide_ha_2,
	};
	private static final int IMAGE_TH[] = {
		R.drawable.img_guide_th_1, 0, 0,
		R.drawable.img_guide_th_2,
		R.drawable.img_guide_th_3, 0, 0,
		R.drawable.img_guide_th_2,
		R.drawable.img_guide_th_1, 0, 0,

		R.drawable.img_guide_th_4, 0, 0,
		R.drawable.img_guide_th_5, R.drawable.img_guide_th_6,
		R.drawable.img_guide_th_7, 0, 0,
		R.drawable.img_guide_th_6, R.drawable.img_guide_th_5,
		R.drawable.img_guide_th_4, 0, 0,
	};
	private static final int IMAGE_SLE[] = {
		R.drawable.img_guide_sle_1, 0, 0,
		R.drawable.img_guide_sle_2, R.drawable.img_guide_sle_3, R.drawable.img_guide_sle_4,
		R.drawable.img_guide_sle_5, 0, 0,
		R.drawable.img_guide_sle_4, R.drawable.img_guide_sle_3, R.drawable.img_guide_sle_2,
	};
	private static final int IMAGE_LLC[] = {
		R.drawable.img_guide_llc_1, 0, 0,
		R.drawable.img_guide_llc_2, R.drawable.img_guide_llc_3, R.drawable.img_guide_llc_4,
		R.drawable.img_guide_llc_5, 0, 0,
		R.drawable.img_guide_llc_4, R.drawable.img_guide_llc_3, R.drawable.img_guide_llc_2,
	};
	private static final int IMAGE_SLC[] = {
		R.drawable.img_guide_slc_1, 0, 0,
		R.drawable.img_guide_slc_2, R.drawable.img_guide_slc_3, R.drawable.img_guide_slc_4,
		R.drawable.img_guide_slc_5, 0, 0,
		R.drawable.img_guide_slc_4, R.drawable.img_guide_slc_3, R.drawable.img_guide_slc_2,
	};
	private static final int IMAGE_RT[] = {
		R.drawable.img_guide_rt_1, 0, 0,
		R.drawable.img_guide_rt_2,
		R.drawable.img_guide_rt_3, 0, 0,
		R.drawable.img_guide_rt_2,
		R.drawable.img_guide_rt_1, 0, 0,

		R.drawable.img_guide_rt_4, 0, 0,
		R.drawable.img_guide_rt_5,
		R.drawable.img_guide_rt_3, 0, 0,
		R.drawable.img_guide_rt_5,
		R.drawable.img_guide_rt_4, 0, 0,
	};
	private static final int IMAGE_SB[] = {
		R.drawable.img_guide_sb_1, 0, 0,
		R.drawable.img_guide_sb_2, R.drawable.img_guide_sb_3, R.drawable.img_guide_sb_4,
		R.drawable.img_guide_sb_5, 0, 0,
		R.drawable.img_guide_sb_4, R.drawable.img_guide_sb_3, R.drawable.img_guide_sb_2,
	};
	private static final int IMAGE_AD[] = {
		R.drawable.img_guide_ad_1, 0, 0,
		R.drawable.img_guide_ad_2, R.drawable.img_guide_ad_3, R.drawable.img_guide_ad_4,
		R.drawable.img_guide_ad_5, 0, 0,
		R.drawable.img_guide_ad_4, R.drawable.img_guide_ad_3, R.drawable.img_guide_ad_2,
	};
	private static final int IMAGE_PRF[] = {
		R.drawable.img_guide_prf_1, 0, 0,
		R.drawable.img_guide_prf_2, R.drawable.img_guide_prf_3,
		R.drawable.img_guide_prf_4, 0, 0,
		R.drawable.img_guide_prf_3, R.drawable.img_guide_prf_2,
		R.drawable.img_guide_prf_1, 0, 0,

		R.drawable.img_guide_prf_5, 0, 0,
		R.drawable.img_guide_prf_6,	R.drawable.img_guide_prf_7,
		R.drawable.img_guide_prf_8, 0, 0,
		R.drawable.img_guide_prf_7, R.drawable.img_guide_prf_6,
		R.drawable.img_guide_prf_5, 0, 0,
	};
	private static final int IMAGE_LP[] = {
		R.drawable.img_guide_lp_1, 0, 0,
		R.drawable.img_guide_lp_2, R.drawable.img_guide_lp_3, R.drawable.img_guide_lp_4,
		R.drawable.img_guide_lp_5, 0, 0,
		R.drawable.img_guide_lp_4, R.drawable.img_guide_lp_3, R.drawable.img_guide_lp_2,
	};
	private static final int IMAGE_BF[] = {
		R.drawable.img_guide_bf_1, 0, 0,
		R.drawable.img_guide_bf_2, R.drawable.img_guide_bf_3, R.drawable.img_guide_bf_4,
		R.drawable.img_guide_bf_5, 0, 0,
		R.drawable.img_guide_bf_4, R.drawable.img_guide_bf_3, R.drawable.img_guide_bf_2,
	};
	private static final int IMAGE_LM[] = {
		R.drawable.img_guide_lm_1, 0, 0,
		R.drawable.img_guide_lm_2, R.drawable.img_guide_lm_3, R.drawable.img_guide_lm_4,
		R.drawable.img_guide_lm_5, 0, 0,
		R.drawable.img_guide_lm_4, R.drawable.img_guide_lm_3, R.drawable.img_guide_lm_2,
	};
	private static final int IMAGE_DP[] = {
		R.drawable.img_guide_dp_1, 0, 0,
		R.drawable.img_guide_dp_2, R.drawable.img_guide_dp_3,
		R.drawable.img_guide_dp_4, 0, 0,
		R.drawable.img_guide_dp_3, R.drawable.img_guide_dp_2,
	};
	private static final int IMAGE_IB[] = {
		R.drawable.img_guide_ib_1, 0, 0,
		R.drawable.img_guide_ib_2, R.drawable.img_guide_ib_3, R.drawable.img_guide_ib_4,
		R.drawable.img_guide_ib_5, 0, 0,
		R.drawable.img_guide_ib_4, R.drawable.img_guide_ib_3, R.drawable.img_guide_ib_2,
	};
	private static final int IMAGE_SCP[] = {
		R.drawable.img_guide_scp_1, 0, 0,
		R.drawable.img_guide_scp_2, R.drawable.img_guide_scp_3, R.drawable.img_guide_scp_4,
		R.drawable.img_guide_scp_5, 0, 0,
		R.drawable.img_guide_scp_4, R.drawable.img_guide_scp_3, R.drawable.img_guide_scp_2,
	};
	private static final int IMAGE_SPR[] = {
		R.drawable.img_guide_spr_1, 0, 0,
		R.drawable.img_guide_spr_2, R.drawable.img_guide_spr_3, R.drawable.img_guide_spr_4,
		R.drawable.img_guide_spr_5, 0, 0,
		R.drawable.img_guide_spr_4, R.drawable.img_guide_spr_3, R.drawable.img_guide_spr_2,
	};
	private static final int IMAGE_IP[] = {
		R.drawable.img_guide_ip_1, 0, 0,
		R.drawable.img_guide_ip_2, R.drawable.img_guide_ip_3, R.drawable.img_guide_ip_4,
		R.drawable.img_guide_ip_5, 0, 0,
		R.drawable.img_guide_ip_4, R.drawable.img_guide_ip_3, R.drawable.img_guide_ip_2,
	};
	private static final int IMAGE_SP[] = {
		R.drawable.img_guide_sp_1, 0, 0,
		R.drawable.img_guide_sp_2, R.drawable.img_guide_sp_3, R.drawable.img_guide_sp_4,
		R.drawable.img_guide_sp_5, 0, 0,
		R.drawable.img_guide_sp_4, R.drawable.img_guide_sp_3, R.drawable.img_guide_sp_2,
	};
	private static final int IMAGE_AC[] = {
		R.drawable.img_guide_ac_1, 0, 0,
		R.drawable.img_guide_ac_2, R.drawable.img_guide_ac_3, R.drawable.img_guide_ac_4,
		R.drawable.img_guide_ac_5, 0, 0,
		R.drawable.img_guide_ac_4, R.drawable.img_guide_ac_3, R.drawable.img_guide_ac_2,
	};
	private static final int IMAGE_ST[] = {
		R.drawable.img_guide_st_1, 0, 0,
		R.drawable.img_guide_st_2, R.drawable.img_guide_st_3,
		R.drawable.img_guide_st_4, 0, 0,
		R.drawable.img_guide_st_3, R.drawable.img_guide_st_2,
	};
	private static final int IMAGE_FO[] = {
		R.drawable.img_guide_fo_1, 0, 0,
		R.drawable.img_guide_fo_2, R.drawable.img_guide_fo_3, R.drawable.img_guide_fo_4,
		R.drawable.img_guide_fo_5, 0, 0,
		R.drawable.img_guide_fo_4, R.drawable.img_guide_fo_3, R.drawable.img_guide_fo_2,
	};
	private static final int IMAGE_TA[] = {
		R.drawable.img_guide_ta_1, 0, 0,
		R.drawable.img_guide_ta_2, R.drawable.img_guide_ta_3, R.drawable.img_guide_ta_4,
		R.drawable.img_guide_ta_5, 0, 0,
		R.drawable.img_guide_ta_4, R.drawable.img_guide_ta_3, R.drawable.img_guide_ta_2,
	};
	private static final int IMAGE_LD[] = {
		R.drawable.img_guide_ld_1, 0, 0,
		R.drawable.img_guide_ld_2, R.drawable.img_guide_ld_3, R.drawable.img_guide_ld_4,
		R.drawable.img_guide_ld_5, 0, 0,
		R.drawable.img_guide_ld_4, R.drawable.img_guide_ld_3, R.drawable.img_guide_ld_2,
	};
	private static final int IMAGE_ITOT[] = {
		R.drawable.img_guide_itot_1, 0, 0,
		R.drawable.img_guide_itot_2, R.drawable.img_guide_itot_3, R.drawable.img_guide_itot_4,
		R.drawable.img_guide_itot_5, 0, 0,
		R.drawable.img_guide_itot_4, R.drawable.img_guide_itot_3, R.drawable.img_guide_itot_2,
		R.drawable.img_guide_itot_1, 0, 0,

		R.drawable.img_guide_itot_6, 0, 0,
		R.drawable.img_guide_itot_7, R.drawable.img_guide_itot_8, R.drawable.img_guide_itot_9,
		R.drawable.img_guide_itot_10, 0, 0,
		R.drawable.img_guide_itot_9, R.drawable.img_guide_itot_8, R.drawable.img_guide_itot_7,
		R.drawable.img_guide_itot_6, 0, 0,
	};
	private static final int IMAGE_CP[] = {
		R.drawable.img_guide_cp_1, 0, 0,
		R.drawable.img_guide_cp_2, R.drawable.img_guide_cp_3, R.drawable.img_guide_cp_4,
		R.drawable.img_guide_cp_5, 0, 0,
		R.drawable.img_guide_cp_4, R.drawable.img_guide_cp_3, R.drawable.img_guide_cp_2,
	};
	private static final int IMAGE_SR[] = {
		R.drawable.img_guide_sr_1, 0, 0,
		R.drawable.img_guide_sr_2, R.drawable.img_guide_sr_3, R.drawable.img_guide_sr_4,
		R.drawable.img_guide_sr_5, 0, 0,
		R.drawable.img_guide_sr_4, R.drawable.img_guide_sr_3, R.drawable.img_guide_sr_2,
	};
	private static final int IMAGE_LPS[] = {
		R.drawable.img_guide_lps_1, 0, 0,
		R.drawable.img_guide_lps_2, R.drawable.img_guide_lps_3, R.drawable.img_guide_lps_4,
		R.drawable.img_guide_lps_5, 0, 0,
		R.drawable.img_guide_lps_4, R.drawable.img_guide_lps_3, R.drawable.img_guide_lps_2,
	};
	private static final int IMAGE_CD[] = {
		R.drawable.img_guide_cd_1, 0, 0,
		R.drawable.img_guide_cd_2, R.drawable.img_guide_cd_3, R.drawable.img_guide_cd_4,
		R.drawable.img_guide_cd_5, 0, 0,
		R.drawable.img_guide_cd_4, R.drawable.img_guide_cd_3, R.drawable.img_guide_cd_2,
	};
	// ...

	private static final int HANDLER_TIMER = 1;
	private static final int INTERVAL_TIMER = 200;	// [msec]

	private MainApplication mApp = null;
	private WeakRefHandler mHandler = null;
	private ToolbarView mToolbarView = null;

	private ImageView mImageGuide = null;
	private ImageButton mButtonLeft = null;
	private ImageButton mButtonRight = null;
	private ImageView mImageGuideSlp = null;
	private ImageView mImageGuideSlpText = null;

	private int mModelId = 0;
	private int mSlpStep = 0;

	private long mElapsedTime = 0;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_guide);

		for (int i=0; i<BUTTON_IDS.length; i++) {
			findViewById(BUTTON_IDS[i]).setOnClickListener(this);
		}

		mApp = (MainApplication)getApplication();
		mHandler = new WeakRefHandler((IOnHandlerMessage)this);
		mToolbarView = (ToolbarView)findViewById(R.id.view_toolbar);

		mImageGuide = (ImageView)findViewById(R.id.image_guide);
		mButtonLeft = (ImageButton)findViewById(R.id.button_arrow_left);
		mButtonRight = (ImageButton)findViewById(R.id.button_arrow_right);
		mImageGuideSlp = (ImageView)findViewById(R.id.image_guide_slp);
		mImageGuideSlpText = (ImageView)findViewById(R.id.image_guide_slp_text);

		mToolbarView.setTitle("Guide");

		mModelId = ConfigData.getPrefInteger(this, ConfigData.PREF_MODEL_IDX, ConfigData.DEF_MODEL_IDX);
		mImageGuideSlp.setImageResource(imageId(0));
	}

	@Override
	protected void onDestroy() {

		super.onDestroy();
	}

	@Override
	protected void onPause() {
		mHandler.removeMessages(HANDLER_TIMER);

		super.onPause();
	} 

	@Override
	protected void onResume() {
		mApp.setHandler(mHandler, true);
		mHandler.sendEmptyMessageDelayed(HANDLER_TIMER, INTERVAL_TIMER);
		mElapsedTime = mApp.rtcGetTimeInMillis();

		checkLanguage();

		super.onResume();
	}

	public void onClick(View arg0) {
		mApp.timeoutReset();

		if (1000 > (mApp.rtcGetTimeInMillis() - mElapsedTime)) {
			return;
		}
		mElapsedTime = mApp.rtcGetTimeInMillis();

		Buzzer.delay(50);
		switch (arg0.getId()) {
		case R.id.button_back:
			setResult(RESULT_OK);
			finish();
			break;
		case R.id.button_warning:
			setResult(RESULT_CANCELED);
			finish();
			break;
		case R.id.button_guide:
			break;

		case R.id.button_arrow_left:
			switch (_serviceLanguage) {
			case ConfigData.SERVICE_LANGUAGE_ENG:
				mImageGuide.setImageResource(R.drawable.img_guide1_eng);
				break;
			case ConfigData.SERVICE_LANGUAGE_KOR:
			default:
				mImageGuide.setImageResource(R.drawable.img_guide1);
				break;
			}
			mButtonLeft.setVisibility(View.INVISIBLE);
			mToolbarView.setVisibility(View.VISIBLE);
			mButtonRight.setVisibility(View.VISIBLE);
			mImageGuideSlp.setVisibility(View.VISIBLE);
			mImageGuideSlpText.setVisibility(View.VISIBLE);
			mImageGuideSlp.setImageResource(imageId(mSlpStep = 0));
			mSlpStep = 0;
			break;
		case R.id.button_arrow_right:
			switch (_serviceLanguage) {
			case ConfigData.SERVICE_LANGUAGE_ENG:
				mImageGuide.setImageResource(R.drawable.img_guide2_eng);
				break;
			case ConfigData.SERVICE_LANGUAGE_KOR:
			default:
				mImageGuide.setImageResource(R.drawable.img_guide2);
				break;
			}
			mButtonLeft.setVisibility(View.VISIBLE);
			mToolbarView.setVisibility(View.INVISIBLE);
			mButtonRight.setVisibility(View.INVISIBLE);
			mImageGuideSlp.setVisibility(View.INVISIBLE);
			mImageGuideSlpText.setVisibility(View.INVISIBLE);
			mSlpStep = -1;
			break;
		}
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		mApp.timeoutReset();

		return super.onTouchEvent(event);
	}

	@Override
	public void handleMessage(Message msg) {
		switch (msg.what) {
		case MainApplication.HANDLER_TIMEOUT_SECOND:
			mToolbarView.setTime(msg.arg1, msg.arg2);
			break;
		case MainApplication.HANDLER_TIMEOUT_ACTIVITY:
			setResult(RESULT_OK);
			finish();
			break;
		case HANDLER_TIMER:
			if (-1 < mSlpStep) {
				int imgStep = ++mSlpStep;
				int imgId = imageId(imgStep);
				if (0 < imgId) {
					mImageGuideSlp.setImageResource(imgId);
				}
			}
			mHandler.sendEmptyMessageDelayed(HANDLER_TIMER, INTERVAL_TIMER);
			break;
		}
	}


	private int imageId(int step) {
		switch (mModelId) {
		case ModelList.IDX_SLP:
			return IMAGE_SLP[step % IMAGE_SLP.length];
		case ModelList.IDX_LS:
			return IMAGE_LS[step % IMAGE_LS.length];
		case ModelList.IDX_HA:
			return IMAGE_HA[step % IMAGE_HA.length];
		case ModelList.IDX_TH:
			return IMAGE_TH[step % IMAGE_TH.length];
		case ModelList.IDX_SLE:
			return IMAGE_SLE[step % IMAGE_SLE.length];
		case ModelList.IDX_LLC:
			return IMAGE_LLC[step % IMAGE_LLC.length];
		case ModelList.IDX_SLC:
			return IMAGE_SLC[step % IMAGE_SLC.length];
		case ModelList.IDX_RT:
			return IMAGE_RT[step % IMAGE_RT.length];
		case ModelList.IDX_SB:
			return IMAGE_SB[step % IMAGE_SB.length];
		case ModelList.IDX_AD:
			return IMAGE_AD[step % IMAGE_AD.length];
		case ModelList.IDX_PRF:
			return IMAGE_PRF[step % IMAGE_PRF.length];
		case ModelList.IDX_LP:
			return IMAGE_LP[step % IMAGE_LP.length];
		case ModelList.IDX_BF:
			return IMAGE_BF[step % IMAGE_BF.length];
		case ModelList.IDX_LM:
			return IMAGE_LM[step % IMAGE_LM.length];
		case ModelList.IDX_DP:
			return IMAGE_DP[step % IMAGE_DP.length];
		case ModelList.IDX_IB:
			return IMAGE_IB[step % IMAGE_IB.length];
		case ModelList.IDX_SCP:
			return IMAGE_SCP[step % IMAGE_SCP.length];
		case ModelList.IDX_SPR:
			return IMAGE_SPR[step % IMAGE_SPR.length];
		case ModelList.IDX_IP:
			return IMAGE_IP[step % IMAGE_IP.length];
		case ModelList.IDX_SP:
			return IMAGE_SP[step % IMAGE_SP.length];
		case ModelList.IDX_AC:
			return IMAGE_AC[step % IMAGE_AC.length];
		case ModelList.IDX_ST:
			return IMAGE_ST[step % IMAGE_ST.length];
		case ModelList.IDX_FO:
			return IMAGE_FO[step % IMAGE_FO.length];
		case ModelList.IDX_TA:
			return IMAGE_TA[step % IMAGE_TA.length];
		case ModelList.IDX_LD:
			return IMAGE_LD[step % IMAGE_LD.length];
		case ModelList.IDX_ITOT:
			return IMAGE_ITOT[step % IMAGE_ITOT.length];
		case ModelList.IDX_CP:
			return IMAGE_CP[step % IMAGE_CP.length];
		case ModelList.IDX_SR:
			return IMAGE_SR[step % IMAGE_SR.length];
		case ModelList.IDX_LPS:
			return IMAGE_LPS[step % IMAGE_LPS.length];
		case ModelList.IDX_CD:
			return IMAGE_CD[step % IMAGE_CD.length];
			// ...
		}

		return 0;
	}

	private int _serviceLanguage = -1;
	private void checkLanguage() {
		int language = ConfigData.getPrefInteger(this, ConfigData.PREF_SERVICE_LANGUAGE, ConfigData.DEF_SERVICE_LANGUAGE);
		if (_serviceLanguage == language) {
			return;
		}
		_serviceLanguage = language;

		int bgId = 0, imgId = 0;
		switch (_serviceLanguage) {
		case ConfigData.SERVICE_LANGUAGE_ENG:
			bgId = R.drawable.img_guide1_eng;
			switch (mModelId) {
			case ModelList.IDX_SLP:
				imgId = R.drawable.img_guide_slp_text_eng;
				break;
			case ModelList.IDX_LS:
				imgId = R.drawable.img_guide_ls_text_eng;
				break;
			case ModelList.IDX_HA:
				imgId = R.drawable.img_guide_ha_text_eng;
				break;
			case ModelList.IDX_TH:
				imgId = R.drawable.img_guide_th_text_eng;
				break;
			case ModelList.IDX_SLE:
				imgId = R.drawable.img_guide_sle_text_eng;
				break;
			case ModelList.IDX_LLC:
				imgId = R.drawable.img_guide_llc_text_eng;
				break;
			case ModelList.IDX_SLC:
				imgId = R.drawable.img_guide_slc_text_eng;
				break;
			case ModelList.IDX_RT:
				imgId = R.drawable.img_guide_rt_text_eng;
				break;
			case ModelList.IDX_SB:
				imgId = R.drawable.img_guide_sb_text_eng;
				break;
			case ModelList.IDX_AD:
				imgId = R.drawable.img_guide_ad_text_eng;
				break;
			case ModelList.IDX_PRF:
				imgId = R.drawable.img_guide_prf_text_eng;
				break;
			case ModelList.IDX_LP:
				imgId = R.drawable.img_guide_lp_text_eng;
				break;
			case ModelList.IDX_BF:
				imgId = R.drawable.img_guide_bf_text_eng;
				break;
			case ModelList.IDX_LM:
				imgId = R.drawable.img_guide_lm_text_eng;
				break;
			case ModelList.IDX_DP:
				imgId = R.drawable.img_guide_dp_text_eng;
				break;
			case ModelList.IDX_IB:
				imgId = R.drawable.img_guide_ib_text_eng;
				break;
			case ModelList.IDX_SCP:
				imgId = R.drawable.img_guide_scp_text_eng;
				break;
			case ModelList.IDX_SPR:
				imgId = R.drawable.img_guide_spr_text_eng;
				break;
			case ModelList.IDX_IP:
				imgId = R.drawable.img_guide_ip_text_eng;
				break;
			case ModelList.IDX_SP:
				imgId = R.drawable.img_guide_sp_text_eng;
				break;
			case ModelList.IDX_AC:
				imgId = R.drawable.img_guide_ac_text_eng;
				break;
			case ModelList.IDX_ST:
				imgId = R.drawable.img_guide_st_text_eng;
				break;
			case ModelList.IDX_FO:
				imgId = R.drawable.img_guide_fo_text_eng;
				break;
			case ModelList.IDX_TA:
				imgId = R.drawable.img_guide_ta_text_eng;
				break;
			case ModelList.IDX_LD:
				imgId = R.drawable.img_guide_ld_text_eng;
				break;
			case ModelList.IDX_ITOT:
				imgId = R.drawable.img_guide_itot_text_eng;
				break;
			case ModelList.IDX_CP:
				imgId = R.drawable.img_guide_cp_text_eng;
				break;
			case ModelList.IDX_SR:
				imgId = R.drawable.img_guide_sr_text_eng;
				break;
			case ModelList.IDX_LPS:
				imgId = R.drawable.img_guide_lps_text_eng;
				break;
			case ModelList.IDX_CD:
				imgId = R.drawable.img_guide_cd_text_eng;
				break;
				// ...
			}
			break;
		case ConfigData.SERVICE_LANGUAGE_KOR:
		default:
			bgId = R.drawable.img_guide1;
			switch (mModelId) {
			case ModelList.IDX_SLP:
				imgId = R.drawable.img_guide_slp_text;
				break;
			case ModelList.IDX_LS:
				imgId = R.drawable.img_guide_ls_text;
				break;
			case ModelList.IDX_HA:
				imgId = R.drawable.img_guide_ha_text;
				break;
			case ModelList.IDX_TH:
				imgId = R.drawable.img_guide_th_text;
				break;
			case ModelList.IDX_SLE:
				imgId = R.drawable.img_guide_sle_text;
				break;
			case ModelList.IDX_LLC:
				imgId = R.drawable.img_guide_llc_text;
				break;
			case ModelList.IDX_SLC:
				imgId = R.drawable.img_guide_slc_text;
				break;
			case ModelList.IDX_RT:
				imgId = R.drawable.img_guide_rt_text;
				break;
			case ModelList.IDX_SB:
				imgId = R.drawable.img_guide_sb_text;
				break;
			case ModelList.IDX_AD:
				imgId = R.drawable.img_guide_ad_text;
				break;
			case ModelList.IDX_PRF:
				imgId = R.drawable.img_guide_prf_text;
				break;
			case ModelList.IDX_LP:
				imgId = R.drawable.img_guide_lp_text;
				break;
			case ModelList.IDX_BF:
				imgId = R.drawable.img_guide_bf_text;
				break;
			case ModelList.IDX_LM:
				imgId = R.drawable.img_guide_lm_text;
				break;
			case ModelList.IDX_DP:
				imgId = R.drawable.img_guide_dp_text;
				break;
			case ModelList.IDX_IB:
				imgId = R.drawable.img_guide_ib_text;
				break;
			case ModelList.IDX_SCP:
				imgId = R.drawable.img_guide_scp_text;
				break;
			case ModelList.IDX_SPR:
				imgId = R.drawable.img_guide_spr_text;
				break;
			case ModelList.IDX_IP:
				imgId = R.drawable.img_guide_ip_text;
				break;
			case ModelList.IDX_SP:
				imgId = R.drawable.img_guide_sp_text;
				break;
			case ModelList.IDX_AC:
				imgId = R.drawable.img_guide_ac_text;
				break;
			case ModelList.IDX_ST:
				imgId = R.drawable.img_guide_st_text;
				break;
			case ModelList.IDX_FO:
				imgId = R.drawable.img_guide_fo_text;
				break;
			case ModelList.IDX_TA:
				imgId = R.drawable.img_guide_ta_text;
				break;
			case ModelList.IDX_LD:
				imgId = R.drawable.img_guide_ld_text;
				break;
			case ModelList.IDX_ITOT:
				imgId = R.drawable.img_guide_itot_text;
				break;
			case ModelList.IDX_CP:
				imgId = R.drawable.img_guide_cp_text;
				break;
			case ModelList.IDX_SR:
				imgId = R.drawable.img_guide_sr_text;
				break;
			case ModelList.IDX_LPS:
				imgId = R.drawable.img_guide_lps_text;
				break;
			case ModelList.IDX_CD:
				imgId = R.drawable.img_guide_cd_text;
				break;
				// ...
			}
			break;
		}

		if (0 < bgId) {
			mImageGuide.setImageResource(bgId);
		}
		if (0 < imgId) {
			mImageGuideSlpText.setImageResource(imgId);
		}
	}
}
